package br.edu.fucapi.pos.model.dao;
import java.util.List;

import javax.persistence.EntityManager;
public class LancamentoDAO {
	
	private EntityManager em;
	public LancamentoDAO(EntityManager em) {
		this.em = em;
	}
	public List<String> buscaLancamentos(String descricao) {
		return em
			.createQuery(
					"select l.nome from Lancamento l "
							+ "where lower(l.descricao) like :descricao",
					String.class)
			.setParameter("descricao", "%" + descricao.toLowerCase() + "%")
			.getResultList();
	}
}